<div class="content-section implementation GridDemo clearfixes constructionOverview">
  <div class="ui-g">
    <div class="ui-g-12 ui-md-12 ui-lg-12 ">
    <div class="mysearch">
      <div class="ui-g">
        <div class="ui-g-4 ui-sm-12">
          <label class="ui-g-2 ui-sm-5 text-right">施工单号:</label>
          <div class="ui-g-4  ui-sm-7 ui-fluid">
            <input pInputText type="text" name="sid" placeholder="入库单号" [(ngModel)]="queryModel.condition.sid" />
          </div>
          <label class="ui-g-2 ui-sm-5 ui-no-padding-left-15px text-right">申请人:</label>
          <div class="ui-g-4 ui-sm-7 ui-fluid  ui-no-padding-right-15px ">
            <input  pInputText type="text" name="status" placeholder="申请人"  [(ngModel)]="queryModel.condition.submitter" />
          </div>
        </div>
        <div class="ui-g-4 ui-sm-12">
          <label class="ui-g-3 ui-sm-5 text-right">申请时间:</label>
          <div class="ui-g-4  ui-sm-7 ui-fluid">
            <p-calendar  [showIcon]="true" [locale]="zh" name="time_start"
                         [styleClass]="'schedule-add'" dateFormat="yy-mm-dd"  dataType="string"
                         [minDate]="minDate" [(ngModel)]="queryModel.condition.begin_time"  >
            </p-calendar>
          </div>
          <label class="ui-g-1 ui-sm-5" >至:</label>
          <div class="ui-g-4  ui-sm-7 ui-fluid ">
            <p-calendar  [showIcon]="true" [locale]="zh" name="end_time"
                         [styleClass]="'schedule-add'" dateFormat="yy-mm-dd" dataType="string"
                         [minDate]="minDate" [(ngModel)]="queryModel.condition.end_time" >
            </p-calendar>
          </div>
        </div>

        <div class="ui-g-4 ui-sm-12">
          <label  class="ui-g-3 ui-sm-5 text-right">状态:</label>
          <div class="ui-g-5  ui-sm-7 ui-fluid ">
            <p-dropdown [options]="ConstructionStatusData" [(ngModel)]="queryModel.condition.status" [autoWidth]="false" name="cycle" (onChange)="suggestInsepectiones()" ></p-dropdown>
          </div>
          <div class="ui-g-4 ui-sm-12  ">
            <button pButton type="button" label="查询" ngClass="ui-sm-12" (click)="suggestInsepectiones()" ></button>
            <button pButton  label="清空" ngClass="ui-sm-12"  (click)="clearSearch()"></button>
          </div>
        </div>
      </div>
    </div>
    </div>
  </div>

  <div class="ui-g">
    <div class="ui-g-12 ui-md-12 ui-lg-12">
      <p-dataTable [value]="ConstructionData"
                   [totalRecords]="totalRecords"  [(selection)]="selectMaterial" >
        <p-column  field="sid" header="施工单号" [sortable]="true" >
          <ng-template let-data="rowData" pTemplate="body" let-i="rowIndex">
            <span (click)="viewContructionApproved(data)" class="curser">{{data.sid}}</span>
          </ng-template>
        </p-column>
        <p-column  *ngFor="let col of cols" field="{{col.field}}" header="{{col.header}}"  [sortable]="true"></p-column>
        <p-column  field="data" header="施工时段" [sortable]="true" >
          <ng-template let-data="rowData" pTemplate="body" let-i="rowIndex">
            <span>{{data['timeGroup']}}</span>
          </ng-template>
        </p-column>
        <ng-template pTemplate="emptymessage">
          当前没有数据
        </ng-template>
        <p-column header="操作">
          <ng-template let-car="rowData" pTemplate="body" let-i="rowIndex">
            <button  pButton type="button"  label="编辑"  *ngIf="ConstructionData[i]['status'] === '新建' || ConstructionData[i]['status'] === '已驳回'" (click)="updateOption(ConstructionData[i])" ></button>
            <button  pButton type="button"  label="删除"  *ngIf="ConstructionData[i]['status'] === '新建' "  (click)="deleteoption(ConstructionData[i])"   ></button>
            <button  pButton type="button"  label="审批"  *ngIf="ConstructionData[i]['status'] === '待审批'"  (click)="approvedOption(ConstructionData[i])"></button>
            <button  pButton type="button"  label="施工"   *ngIf="ConstructionData[i]['status'] === '待施工'" (click)="constructionOption(ConstructionData[i])"  ></button>
            <button  pButton type="button"  label="施工完成"   *ngIf="ConstructionData[i]['status'] === '施工中'" (click)="constructionComplate(ConstructionData[i])" ></button>
            <button  pButton type="button"  label="复核"   *ngIf="ConstructionData[i]['status'] === '待复核'" (click)="constructionReview(ConstructionData[i])" ></button>
            <button  pButton type="button"  label="整改"   *ngIf="ConstructionData[i]['status'] === '复核-不通过'"   (click)="constructionRectification(ConstructionData[i])"></button>
            <button  pButton type="button"  label="关闭"   *ngIf="ConstructionData[i]['status'] === '复核-通过'"  (click)="closeconstruction(ConstructionData[i])" ></button>
            <button  pButton type="button"  label="查看" *ngIf="ConstructionData[i]['status'] !== '已完成' || ConstructionData[i]['status'] === '已拒绝'"  (click)="viewContructionApproved(ConstructionData[i])"   ></button>
          </ng-template>
        </p-column>
      </p-dataTable>
      <p-paginator rows="10" [totalRecords]="totalRecords" [rowsPerPageOptions]="[10,20,30]" (onPageChange)="paginate($event)"></p-paginator>
    </div>
  </div>
</div>



